<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="java.util.*" %>
<%@ page import="com.ionglobal.db.*" %>
<%@ page import="com.ionglobal.lib.*" %>
<%@ page import="com.ionglobal.misc.*" %>

<%@ include file="../init_include.jsp" %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<%=Language.getHTMLLanguageStr()%>">
<link rel="stylesheet" href="../css.css" type="text/css">
<title><%=Language.getNameByCode("sys.category.dj.title","Edit Or Add Category")%></title>
</head>
<body>
<%=Language.getNameByCode("sys.CurrentPos","Current Position")%>:<%=Language.getNameByCode("sys.category.dj.title","Edit Or Add Category")%><br> 
<hr>   
 <table border="0" cellspacing="1" cellpadding="2" class="input_title">
<%	
	String sql="select id,parentid,name from sys_category where parentid=-1";
	dbi.execQuery(sql);
	while(dbi.rsNext()) {
%>	
   <tr>
     <td align="left">&nbsp;&nbsp;<%=dbi.rsGetInt("id")%></td>
     <td align="right">&nbsp;<%=dbi.rsGetInt("parentid")%></td>
     <td align="right">&nbsp;<%=dbi.rsGetString("name")%></td>
   </tr>   
<%
		sql="select id,parentid,name from sys_category where parentid="+dbi.rsGetInt("id");
		dbi.execQuery(sql);
		while(dbi.rsNext())
		{		
%>
   <tr>
     <td align="left">&nbsp;&nbsp;&nbsp;&nbsp;<%=dbi.rsGetInt("id")%></td>
     <td align="right">&nbsp;<%=dbi.rsGetInt("parentid")%></td>
     <td align="right">&nbsp;<%=dbi.rsGetString("name")%></td>
   </tr>   
<%   	
			sql="select id,parentid,name from sys_category where parentid="+dbi.rsGetInt("id");
			dbi.execQuery(sql);
			while(dbi.rsNext())
			{		
%>
   <tr>
     <td align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=dbi.rsGetInt("id")%></td>
     <td align="right">&nbsp;<%=dbi.rsGetInt("parentid")%></td>
     <td align="right">&nbsp;<%=dbi.rsGetString("name")%></td>
   </tr>   
<%   	
				sql="select id,parentid,name from sys_category where parentid="+dbi.rsGetInt("id");
				dbi.execQuery(sql);
				while(dbi.rsNext())
				{		
%>
   <tr>
     <td align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=dbi.rsGetInt("id")%></td>
     <td align="right">&nbsp;<%=dbi.rsGetInt("parentid")%></td>
     <td align="right">&nbsp;<%=dbi.rsGetString("name")%></td>
   </tr>   
<%			
					sql="select id,parentid,name from sys_category where parentid="+dbi.rsGetInt("id");
					dbi.execQuery(sql);
					while(dbi.rsNext())
					{		
%>
   <tr>
     <td align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=dbi.rsGetInt("id")%></td>
     <td align="right">&nbsp;<%=dbi.rsGetInt("parentid")%></td>
     <td align="right">&nbsp;<%=dbi.rsGetString("name")%></td>
   </tr>   
<%			
					}
					dbi.rsClose();
				}
				dbi.rsClose();
			}
			dbi.rsClose();
		}
		dbi.rsClose();
	}
	dbi.rsClose();	
%>
 </table>
</body>                
</html>        
<%@ include file="../init_free.jsp" %>        
